<!--
 * @Author: wangding
 * @Date: 2020-10-26 11:25:42
 * @LastEditTime: 2020-10-26 16:40:22
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \solaxcloud\src\views\system\menu\tree.vue
-->
<template>
    <div class="scroll-box-tree-box" >
        <el-tree
        :data="allMenusListBig"
        node-key="id"
        :props="defaultProps"
        ref='newTopRightsTree'
        :accordion='true'
        @node-click="handleNodeClick"
        :default-expanded-keys="[0]"
        >
        </el-tree>
    </div>
</template>

<script>
export default {
    components: {

    },
    props: {
        allMenusList:{
            type:Array,
            default:()=>{return []}
        },
    },
    data() {
        return {
            defaultProps: {
                children: 'children',
                label: 'menuName'
            },
        };
    },
    computed: {
        allMenusListBig(){
            let arr = [{
                sid:0,
                menuName:this.$t('role.js_menu'),
                id:0,
                children:this.allMenusList
            }]
            return arr
        }
    },
    watch: {
        
    },
    created() {

    },
    mounted() {
    },
    methods: {
        handleNodeClick(data){
            this.$emit('clickData',data)
        }
    },
};
</script>

<style  lang="less" >
    .scroll-box-tree-box{
        height: 100%;
        .el-tree-node__label {
            color: #000 !important;
        }
    }
</style>
